package solution.easy;

/**
 * @program: solution
 * @ClassName UniqueStr
 * @description: 判断字符串里面的字符不重复
 * @author: yaoguipei
 * @create: 2021-10-06 18:58
 * @Version 1.0
 **/
public class UniqueStr {
    public static void main(String[] args) {
        System.out.println(isUnique("leetcode"));
    }

    public static boolean isUnique(String astr) {
        if(astr.length()==0||astr.length()==1){
            return true;
        }
        for(int i=0;i<astr.length();i++){
            for(int j=0;j<astr.length()&&j!=i;j++){
                if(astr.charAt(i)==astr.charAt(j)){
                    return false;
                }
            }
        }
        return true;
    }
}
